function SetCtrlFromOpt(ctrl, opt)
{
	var hid=document.getElementById(ctrl.optHid);
	hid.value=opt.options[opt.selectedIndex].value;
	if (opt.options[opt.selectedIndex].value==0)
	{
		ctrl.value="";
		ctrl.match="";
	}
	else
	{
		ctrl.value=opt.options[opt.selectedIndex].innerText;
		ctrl.match=ctrl.value;		
	}
	handleItemChangeCore(hid.value);
}
function SetCtrlMatch(ctrl, opt)
{
	var hid=document.getElementById(ctrl.optHid);
	hid.value=opt.options[opt.selectedIndex].value;
	if (hid.value !=0)		
		ctrl.match=opt.options[opt.selectedIndex].innerText;
	else
		ctrl.match="";
	handleItemChangeCore(hid.value);
}

